package com.commerce.mapping;

import com.commerce.model.Admin;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;

/**
 * @author wyj
 * @Title:
 * @Description:
 */
@Mapper
public interface AdminMapping extends BeanMapping<Admin>{

    /**
     * 账号密码查询
     * @param Admin
     * @return
     * @throws DataAccessException
     */
    Admin selectByNamePassword(Admin Admin)throws DataAccessException;

    /**
     * 查询用户名是否有相同
     * @param account
     * @return
     * @throws DataAccessException
     */
    int selectByAccountOrId(@Param("account") String account, @Param("id") Integer id)throws  DataAccessException;

    /**
     * 开启或关闭
     * @param id
     * @return
     * @throws DataAccessException
     */
    int updateByOpen(int id)throws DataAccessException;

    /**
     * 修改密码
     * @param admin
     * @return
     * @throws DataAccessException
     */
    int updateByPwd(Admin admin)throws DataAccessException;

}
